<?php
/**
 * @package quizzes
 * @author Andrew Meredith <andymeredith@gmail.com>
 */
namespace PhpQuizzes;

/**
 * An option for a question
 * This class represents an option for a quiz Question. It is associated with a Personality
 */
class Option {
	/** @property int $_id The unique identifier of this option object in the database */
	private $_id;
	
	/**
	 * @property string $_text The text of this option to be displayed.
	 * Should be an answer to the contianing Question's prompt.
	 */
	private $_text;
	
	/**
	 * Gets the id property
	 */
	public function getId() {
		return $this->_id;
	}
	
	/**
	 * Sets the id property
	 */
	public function setId( $id ) {
		if (is_int( $id )) {
			$this->_id = $id;
		} else {
			throw new InvalidArgumentException("Invalid ID supplied. Expected an integer, but got '$id'");
		}
	}
	
	/**
	 * Gets the text property
	 */
	public function getText() {
		return $this->_text;
	}
	
	/**
	 * Sets the text property
	 */
	public function setText( $text ) {
		$this->_text = $text;
	}
}